﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartHouseOOP
{
    public class Register
    {
        private List<Device> connectedDevices;
        private Resource resourseType;
        public Register(string inputResourceLabel)
        {
            resourseType = new Resource(inputResourceLabel);
            this.connectedDevices = new List<Device>();
        }
        public void ConnectAllDevices(List<Room> rooms)
        {
            foreach (Room room in rooms)
            {
                connectedDevices.AddRange(room.GetAllDevicesByType(resourseType));
            }
        }
        
        public void CountResourse()
        {
            //подсчет всей воды
            //foreach (device in connectedWaterDevices)
            //{ sum+=device.getConsumed}
        }
        // new
        public Resource ResourseType
        {
            get
            {
                return this.resourseType;
            }
        }

    }
}
